!{include file='common/iheader.htm'}
<div id="i_nav">
	<h3 class="page_title">添加角色 </h3>
	<a class="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" href="/admin.php?app=user">
		<span class="ui-icon ui-icon-document"></span>用户管理
	</a>
	<a class="button ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" href="/admin.php?app=user&act=role">
		<span class="ui-icon ui-icon-document"></span>角色管理
	</a>
</div>
<form method="post">
	<div class="form_item">
		<strong>角色名称：</strong>
		<div><input type="text" name="name" class="text_input" value="!{$role.name}"/></div>
		<p></p>
	</div>
	<div class="form_item">
		<strong>描述：</strong>
		<div><textarea name="desc">!{$role.desc}</textarea></div>
		<p></p>
	</div>
	<div class="form_item acl_form_item">
		<strong>权限：</strong>
		<div>!{include file='acl/list.htm'}</div>
		<p></p>
	</div>
	<div class="form_item form_btn_item">
		<input type="submit" class="button ui-button ui-widget ui-state-default ui-corner-all" value="保存"/>
		<input type="hidden" name="site_id" value="!{$site_id}">
	</div>
</form>
<script language="javascript">
	$(function(){
		$('input[name="namespace"]').click(function(){
			if($(this).attr('checked') == 'checked'){
				$(this).parents('.acl_li').find('input[type="checkbox"]').attr('checked','checked');
			}else{
				$(this).parents('.acl_li').find('input[type="checkbox"]').removeAttr('checked');
			}
		});
	});
</script>
!{include file='common/ifooter.htm'}